<?php

class PreferencesView implements View
{
    protected $entries = array();
    
    public function __construct()
    {
        $this->entries = array(
            'userdata' => array(
                'name',
                'email',
                'password'
            ),
            'general' => array(
            )
        );
    }
    
    public function data()
    {
        $ret = array();
        foreach ($this->entries as $catname => $earr) {
            $cat = array('legend' => $catname, 'input' => array());
            foreach ($earr as $entry) {
                $cat['input'][] = array('label' => '{L_'.$entry.'}', 'type' => 'text', 'name' => $entry);
            }
            $ret[] = $cat;
        }
        
        return $ret;
    }
    
    public function module()
    {
        return 'content';
    }
    
    public function templateFile()
    {
        return 'preferences';
    }
}